package main

import "fmt"

/*
*
外观/门面模式
*/
func main() {
	party := HomeParty{}
	party.PlayGame()
	party.WatchMovie()
	party.Sleep()
}

type HomeParty struct {
	TV      TV
	GameBox GameBox
	Light   Light
}

func (h HomeParty) PlayGame() {
	fmt.Println("...打游戏很开心...")
	h.GameBox.On()
	h.Light.Off()
	h.TV.Off()
}

func (h HomeParty) WatchMovie() {
	fmt.Println("...看电影很开心...")
	h.GameBox.Off()
	h.Light.Off()
	h.TV.On()
}

func (h HomeParty) Sleep() {
	fmt.Println("...早睡早起身体好...")
	h.GameBox.Off()
	h.Light.Off()
	h.TV.Off()
}

// Status 物品的状态
type Status interface {
	On()
	Off()
}

type TV struct {
}

func (T TV) On() {
	fmt.Println("打开电视机...")
}

func (T TV) Off() {
	fmt.Println("关闭电视机...")
}

type GameBox struct {
}

func (g GameBox) On() {
	fmt.Println("打开游戏机...")
}

func (g GameBox) Off() {
	fmt.Println("关闭游戏机...")
}

type Light struct {
}

func (l Light) On() {
	fmt.Println("打开灯光...")
}

func (l Light) Off() {
	fmt.Println("关闭灯光...")
}
